import java.sql.Connection;

/**
 * 测试 DbUtil 连接
 *
 * @author zhu
 * @date 2024-04-08
 */
public class MainTest02 {
    public static void main(String[] args) {
        add();
    }

    private static void del() {
        String sql = "delete from staffs where id = ?";
        Connection conn = DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(conn);
        int r = sqlRunner.update(sql,1);
        System.out.println(r);
    }

    private static void add() {
        String sql = "insert into staffs(name,age,phone,sta_pos) values (?,?,?,?)" ;
        Connection connection = DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(connection) ;
        int r = sqlRunner.update(sql, "大傻椿", 22, "13417747371", "清洁工");
        System.out.println(r);
    }
}
